package com.elh.nio.test;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

/**
 * @author liulei
 **/
public class Client {

    public static void main(String[] args) throws IOException, InterruptedException {
        Socket socket = new Socket("localhost",6666);
        OutputStream outputStream = socket.getOutputStream();
        outputStream.write("我是外星人".getBytes());
        Thread.sleep(3000);
        outputStream.write("我是外星人2".getBytes());
        Thread.sleep(3000);
        outputStream.write("我是外星人3".getBytes());
        outputStream.close();
    }

}
